/**
 * 
 */
package com.ge.healthcare.autosc.common.database.dao;

import java.util.ArrayList;
import java.util.List;

import com.ge.healthcare.autosc.common.ASCUtil;
import com.ge.healthcare.autosc.common.database.pojo.CfgProdiagsBlockList;

/**
 * @author 212042764
 * 
 */
public class ProDiagsBlockDAO extends BaseDAO implements IProdiagBlockListDAO {
	private static final String TABLE_NAME = "com.ge.healthcare.autosc.common.database.pojo.CfgProDiagBlockList";
	private static final String COL_PRODIAG_IGN_ID = "proDiagIgnId";

	/**
	 * 
	 */
	private static final long serialVersionUID = -6375600278822204792L;

	protected ProDiagsBlockDAO() {
		super(TABLE_NAME);
	}

	public List<CfgProdiagsBlockList> getProdiagsBlockByProDiagIgnId(
			Long proDiagIgnId) {
		List<?> rtvdLst = findByProperty(COL_PRODIAG_IGN_ID, proDiagIgnId);
		List<CfgProdiagsBlockList> blockLst = new ArrayList<CfgProdiagsBlockList>();
		if (!ASCUtil.isNullOrEmptyList(rtvdLst)) {
			for (Object prodiagBlockPattern : rtvdLst) {
				blockLst.add((CfgProdiagsBlockList) prodiagBlockPattern);
			}
		}
		return blockLst;
	}

	public void saveAlways(Object pojo) {
		super.save(pojo);
	}
}
